package com.yupi.yuojcodesandbox.judge.codesandbox.impl;



import com.yupi.yuojcodesandbox.judge.codesandbox.CodeSandbox;
import com.yupi.yuojcodesandbox.judge.codesandbox.enums.JudgeInfoMessageEnum;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.ExecuteCodeRequest;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.ExecuteCodeResponse;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.JudgeInfo;

import java.util.List;

/**
 * @Author:Dong
 * @Date: 2024/4/20  10:53
 * @Version 1.0
 * 实现远程调用代码沙箱
 */
public class RemoteCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();
        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        executeCodeResponse.setOutputList(inputList);
        executeCodeResponse.setMessage("远程代码沙箱");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPTED.getText());
        judgeInfo.setMemory(100L);
        judgeInfo.setTime(100L);
        executeCodeResponse.setJudgeInfo(judgeInfo);
        return executeCodeResponse;
    }

}
